package cc.wanforme.fsync.entity.device;

import cc.wanforme.st.server.util.FileUtil;
import org.springframework.beans.BeanUtils;

public class DeviceInfoVo extends DeviceInfo {

    private String totalSpaceStr; // 总空间

    private String usableSpaceStr; // 剩余空间

    public DeviceInfoVo(){}

    public DeviceInfoVo(DeviceInfo di){
        BeanUtils.copyProperties(di, this);

        setTotalSpaceStr(FileUtil.readableFileSize(di.getTotalSpace()));
        setUsableSpaceStr(FileUtil.readableFileSize(di.getUsableSpace()));
    }

    public String getTotalSpaceStr() {
        return totalSpaceStr;
    }

    public void setTotalSpaceStr(String totalSpaceStr) {
        this.totalSpaceStr = totalSpaceStr;
    }

    public String getUsableSpaceStr() {
        return usableSpaceStr;
    }

    public void setUsableSpaceStr(String usableSpaceStr) {
        this.usableSpaceStr = usableSpaceStr;
    }
}
